package cn.longg.controller;

import cn.longg.entity.Result;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice

public class ExceptionController {

    @ExceptionHandler
    @ResponseBody
    public Result exception(Exception e){
        return new Result(false,e.getMessage(),e);
    }
}
